package first.progr.tc;

import com.google.common.collect.ComparisonChain;

public class ContactData implements Comparable<ContactData> {
	private String FirstName;
	private String LastName;
	private String Address;
	private String HomePhone;
	private String MobilePhone;
	private String WorkPhone;
	private String MainEmail;
	private String ExtraEmail;
	private String BirthDay;
	private String BirthMonth;
	private String BirthYear;
	private String GroupAssaign;
	private String SecondAddress;
	private String HomeWebPage;

	public ContactData() {
	}

	public ContactData(String contactFirstName, String contactLastName,
			String contactAddress, String contactHomePhone,
			String contactMobilePhone, String contactWorkPhone,
			String contactMainEmail, String contactExtraEmail,
			String contactBirthDay, String contactBirthMonth,
			String contactBirthYear, String contactGroupAssaign,
			String contactSecondAddress, String contactHomeWebPage) {
		this.FirstName = contactFirstName;
		this.LastName = contactLastName;
		this.Address = contactAddress;
		this.HomePhone = contactHomePhone;
		this.MobilePhone = contactMobilePhone;
		this.WorkPhone = contactWorkPhone;
		this.MainEmail = contactMainEmail;
		this.ExtraEmail = contactExtraEmail;
		this.BirthDay = contactBirthDay;
		this.BirthMonth = contactBirthMonth;
		this.BirthYear = contactBirthYear;
		this.GroupAssaign = contactGroupAssaign;
		this.SecondAddress = contactSecondAddress;
		this.HomeWebPage = contactHomeWebPage;
	}

	@Override
	public String toString() {
		return "ContactData [FirstName=" + FirstName + ", LastName=" + LastName
				+ ", MainEmail=" + MainEmail + ", HomePhone=" + HomePhone + "]";
	}

	@Override
	public int hashCode() {
		// final int prime = 31;
		int result = 1;
		/*
		 * result = prime * result + ((HomePhone == null) ? 0 :
		 * HomePhone.hashCode()); result = prime * result + ((FirstName == null)
		 * ? 0 : FirstName.hashCode()); result = prime * result + ((LastName ==
		 * null) ? 0 : LastName.hashCode()); result = prime * result +
		 * ((MainEmail == null) ? 0 : MainEmail.hashCode());
		 */
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (HomePhone == null) {
			if (other.HomePhone != null)
				return false;
		} else if (!HomePhone.equals(other.HomePhone))
			return false;
		if (FirstName == null) {
			if (other.FirstName != null)
				return false;
		} else if (!FirstName.equals(other.FirstName))
			return false;
		if (LastName == null) {
			if (other.LastName != null)
				return false;
		} else if (!LastName.equals(other.LastName))
			return false;
		if (MainEmail == null) {
			if (other.MainEmail != null)
				return false;
		} else if (!MainEmail.equals(other.MainEmail))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData another) {
		return ComparisonChain
				.start()
				.compare(LastName.toLowerCase(), another.LastName.toLowerCase())
				.compare(FirstName.toLowerCase(),
						another.FirstName.toLowerCase())
				.compare(MainEmail.toLowerCase(),
						another.MainEmail.toLowerCase())
				.compare(HomePhone.toLowerCase(),
						another.HomePhone.toLowerCase()).result();
	}

	public ContactData withFitstName(String FirstName) {
		this.FirstName = FirstName;
		return this;
	}

	public ContactData withLastName(String LastName) {
		this.LastName = LastName;
		return this;
	}

	public ContactData withAddress(String Address) {
		this.Address = Address;
		return this;
	}

	public ContactData withHomePhone(String HomePhone) {
		this.HomePhone = HomePhone;
		return this;
	}

	public ContactData withMobilePhone(String MobilePhone) {
		this.MobilePhone = MobilePhone;
		return this;
	}

	public ContactData withWorkPhone(String WorkPhone) {
		this.WorkPhone = WorkPhone;
		return this;
	}

	public ContactData withMainEmail(String MainEmail) {
		this.MainEmail = MainEmail;
		return this;
	}

	public ContactData withExtraEmail(String ExtraEmail) {
		this.ExtraEmail = ExtraEmail;
		return this;
	}

	public ContactData withBirthDay(String BirthDay) {
		this.BirthDay = BirthDay;
		return this;
	}

	public ContactData withBirthMonth(String BirthMonth) {
		this.BirthMonth = BirthMonth;
		return this;
	}

	public ContactData withBirthYear(String BirthYear) {
		this.BirthYear = BirthYear;
		return this;
	}

	public ContactData withGroupAssaign(String GroupAssaign) {
		this.GroupAssaign = GroupAssaign;
		return this;
	}

	public ContactData withSecondAddress(String SecondAddress) {
		this.SecondAddress = SecondAddress;
		return this;
	}

	public ContactData withHomeWebPage(String HomeWebPage) {
		this.HomeWebPage = HomeWebPage;
		return this;
	}

	public String getFirstName() {
		return FirstName;
	}

	public String getLastName() {
		return LastName;
	}

	public String getAddress() {
		return Address;
	}

	public String getMobilePhone() {
		return MobilePhone;
	}

	public String getHomePhone() {
		return HomePhone;
	}

	public String getWorkPhone() {
		return WorkPhone;
	}

	public String getMainEmail() {
		return MainEmail;
	}

	public String getExtraEmail() {
		return ExtraEmail;
	}

	public String getBirthDay() {
		return BirthDay;
	}

	public String getBirthMonth() {
		return BirthMonth;
	}

	public String getBirthYear() {
		return BirthYear;
	}

	public String getGroupAssaign() {
		return GroupAssaign;
	}

	public String getSecondAddress() {
		return SecondAddress;
	}

	public String getHomeWebPage() {
		return HomeWebPage;
	}
}